﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CameraSystem
{
    public partial class UpdateForm : Form
    {
        int modeF = 0;
        public delegate void FormDele(int mode, string str);
        public event FormDele OnFormDele;
        public UpdateForm(int mode)
        {
            InitializeComponent();

            modeF = mode;
            if (mode == 1)
            {
                Text = "條碼長度";

                //uiTextBox1.Text = Form1.CodeLength.ToString();

            }
            //else if (mode == 2) { Text = "線別"; uiTextBox1.Text = Form1.LineMode.ToString(); }
            //else if (mode == 3) { Text = "勁拓AOI字符"; uiTextBox1.Text = Form1.ContainStr; }
            //else if (mode == 4) { Text = "AOI服務器"; uiTextBox1.Text = Form1.ServerPath; }
        }

        private void uiButton1_Click(object sender, EventArgs e)
        {

            OnFormDele(modeF, uiTextBox1.Text);


            this.Close();
            //if (modeF == 1)
            //{
            //    OnFormDele(uiTextBox1.Text);
            //}
            //else if (modeF == 2) { Text = "線別"; uiTextBox1.Text = Form1.LineMode.ToString(); }
            //else if (modeF == 3) { Text = "勁拓AOI字符"; uiTextBox1.Text = Form1.ContainStr; }
            //else if (modeF == 4) { Text = "AOI服務器"; uiTextBox1.Text = Form1.ServerPath; }
        }
    }
}
